﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;

namespace FC.Model
{
    public class BaseTreePoco<T>: TreePoco<T>, IBasePoco, IPersistPoco
         where T : TreePoco<T>
    {//
        // 摘要:
        //     CreateTime
        [Display(Name = "_Admin.CreateTime")]
        public DateTime? CreateTime { get; set; }
        //
        // 摘要:
        //     CreateBy
        [Display(Name = "_Admin.CreateBy")]
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string CreateBy { get; set; }
        //
        // 摘要:
        //     UpdateTime
        [Display(Name = "_Admin.UpdateTime")]
        public DateTime? UpdateTime { get; set; }
        //
        // 摘要:
        //     UpdateBy
        [Display(Name = "_Admin.UpdateBy")]
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string UpdateBy { get; set; }
        //
        // 摘要:
        //     IsValid
        [Display(Name = "_Admin.IsValid")]
        public bool IsValid { get; set; }

    }
    public class TaskItem: BaseTreePoco<TaskItem>
    {
        [Display(Name = "标题")]
        public string Name { get; set; }
        [Display(Name = "任务描述")]
        public string Description { get; set; }

        [Display(Name = "迭代")]
        public Guid? IterationId { get; set; }
     
        public Iteration Iteration { get; set; }

        [Display(Name = "完成人")]
        public Guid? FinishedUserId { get; set; }

        public FrameworkUser FinishedUser { get; set; }
        [Display(Name = "任务状态")]
        public TaskItemStatus TaskStatus { get; set; }
    }
    public enum TaskItemStatus
    {
        [Display(Name = "未开始")]
        NotStart,
        [Display(Name = "迭代中")]
        Starting,
        [Display(Name = "已完成")]
        Finished
    }
}
